import request from '@/utils/request'

/** 园区管理-企业列表 */
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

/** 添加企业 */
export function addEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'post',
    data
  })
}

/** 获取企业所属行业列表 */
export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}

/** 上传合同 */
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}

/** 编辑企业 */
export function editEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'put',
    data
  })
}

/** 查看企业 */
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

/** 查看企业 */
export function deleteEnterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'delete'
  })
}

/** 获取楼宇列表 */
export function getRentBuildListAPI() {
  return request({
    url: '/park/rent/building'
  })
}

/** 创建合同 */
export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}
/** 获取合同列表 */
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

/** 退租租赁合同 */
export function outRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'PUT'
  })
}

/** 获取详情 */
export function getEnterpriseDetail(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}
